package jp.tuyano.sample.server;

import com.google.gdata.client.spreadsheet.SpreadsheetService;
import com.google.gdata.util.AuthenticationException;

public class SSServiceCreator {

	private String appliName;
	
	public SSServiceCreator(String appliName) {
		this.appliName = appliName;
	}
	
	public SpreadsheetService create(String userName, String password) {
		
		SpreadsheetService spreadsheetService = new SpreadsheetService(
				appliName);
		
		try {
			spreadsheetService.setUserCredentials(userName, password);
		} catch (AuthenticationException e) {
			e.printStackTrace();
			return null;
		}
		
		return spreadsheetService;
	}
}
